#include "types.h"
#include "core.h"
#include <crisscross/core_socket.h>
#include <crisscross/tcpsocket.h>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
using namespace CrissCross;
using namespace CrissCross::Network;

extern dSymbol *T;
extern dList *nil;
// Loader
extern "C" void load_module ();

class dSocket : public dObject
{
 public:
  TCPSocket *sock;

  dSocket ();
  dSocket (TCPSocket *socket);
  ~dSocket ();
  string toString ();
};

dObject *dNewSocket (dList *args);
dObject *dConnect (dList *args);
dObject *dListen (dList *args);
dObject *dAccept (dList *args);
dObject *dDisconnect (dList *args);

dObject *dSend (dList *args);
dObject *dRecv (dList *args);
